import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@views/login/login.vue'
import Home from '@views/home/home.vue'
import Welcome from '@views/home/welcome.vue'
import Table_content from '@views/table_content/table_content.vue'
import Image_content from '@views/image_content/image_content.vue'
import Chart_content from '@views/chart_content/chart_content.vue'
import Video_content from '@views/video_content/video_contnet.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path:'/login',
    component:Login
  },
  {
    path:'/home',
    component:Home,
    redirect: '/welcome',
    children:[
      {
        path: '/welcome',
        component: Welcome,
      },
      {
        path: '/table_content',
        component: Table_content,
      },
      {
        path: '/image_content',
        component: Image_content,
      },
      {
        path: '/chart_content',
        component: Chart_content,
      },
      {
        path: '/video_content',
        component: Video_content,
      }
    ]
  },{
    path: '/401',
    component: () => import('@components/error-page/401'),
    hidden: true
  },{
    path: '/404',
    component: () => import('@components/error-page/404'),
    hidden: true
  },
  {
    path: '*',
    redirect: '/404'
  }
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
